package com.zhou.hot.util;

import java.io.File;
import java.lang.instrument.ClassDefinition;
import java.util.List;

/**
 * Created by zhouyongjun on 2020/4/17
 */
public class HotResult {
    public final static HotResult RESULT_FAIL = new HotResult(false);
    public final static HotResult RESULT_SUCC = new HotResult(true);
    boolean isSucc;
    String msg;
    List<File> files;
    List<ClassDefinition> definitions;
    public HotResult(boolean isSucc)
    {
        this.isSucc = isSucc;
    }

    public static HotResult createSuccResult(List<ClassDefinition> definitions,List<File> files)
    {
        HotResult result = new HotResult(true);
        result.definitions = definitions;
        result.files = files;
        return result;
    }
    public static HotResult createFailResult(String msg)
    {
        HotResult result = new HotResult(false);
        result.msg = msg;
        return result;
    }

    public boolean isSucc() {
        return isSucc;
    }

    public boolean isFail() {
        return !isSucc;
    }

    public void setSucc(boolean succ) {
        isSucc = succ;
    }

    public List<File> getFiles() {
        return files;
    }

    public void setFiles(List<File> files) {
        this.files = files;
    }

    public List<ClassDefinition> getDefinitions() {
        return definitions;
    }

    public void setDefinitions(List<ClassDefinition> definitions) {
        this.definitions = definitions;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
